# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataflow.V1b3.Model.LaunchTemplateParameters do
  @moduledoc """
  Parameters to provide to the template being launched. Note that the [metadata in the pipeline code] (https://cloud.google.com/dataflow/docs/guides/templates/creating-templates#metadata) determines which runtime parameters are valid.

  ## Attributes

  *   `environment` (*type:* `GoogleApi.Dataflow.V1b3.Model.RuntimeEnvironment.t`, *default:* `nil`) - The runtime environment for the job.
  *   `jobName` (*type:* `String.t`, *default:* `nil`) - Required. The job name to use for the created job. The name must match the regular expression `[a-z]([-a-z0-9]{0,1022}[a-z0-9])?`
  *   `parameters` (*type:* `map()`, *default:* `nil`) - The runtime parameters to pass to the job.
  *   `transformNameMapping` (*type:* `map()`, *default:* `nil`) - Only applicable when updating a pipeline. Map of transform name prefixes of the job to be replaced to the corresponding name prefixes of the new job.
  *   `update` (*type:* `boolean()`, *default:* `nil`) - If set, replace the existing pipeline with the name specified by jobName with this pipeline, preserving state.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :environment => GoogleApi.Dataflow.V1b3.Model.RuntimeEnvironment.t() | nil,
          :jobName => String.t() | nil,
          :parameters => map() | nil,
          :transformNameMapping => map() | nil,
          :update => boolean() | nil
        }

  field(:environment, as: GoogleApi.Dataflow.V1b3.Model.RuntimeEnvironment)
  field(:jobName)
  field(:parameters, type: :map)
  field(:transformNameMapping, type: :map)
  field(:update)
end

defimpl Poison.Decoder, for: GoogleApi.Dataflow.V1b3.Model.LaunchTemplateParameters do
  def decode(value, options) do
    GoogleApi.Dataflow.V1b3.Model.LaunchTemplateParameters.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataflow.V1b3.Model.LaunchTemplateParameters do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
